﻿@page "/notifications"
@inject IStringLocalizer<Notifications> Localizer

<h3>@Localizer["NotificationsTitle"]</h3>

<DemoBlock Title="@Localizer["NotificationsNormalTitle"]"
           Introduction="@Localizer["NotificationsNormalIntro"]"
           Name="Normal"
           Demo="typeof(Demos.Notifications.NotificationsNormal)">
    <p>@Localizer["NotificationsNormalDescription"]</p>
    <Tips>
        <p>@Localizer["NotificationsNormalTips1"]</p>
    </Tips>
    <div class="mb-3">
        <p>@((MarkupString)Localizer["NotificationsNormalTips2"].Value)</p>
        <Pre>private NotificationItem Model { get; set; } = new NotificationItem();

private async Task Dispatch()
{
    Interop ??= new JSInterop&lt;Notifications&gt;(JSRuntime);
    await BrowserNotification.Dispatch(Interop, this, Model, nameof(ShowNotificationCallback));
}

[JSInvokable]
public void ShowNotificationCallback(bool result)
{
    // callback
    StateHasChanged();
}</Pre>
    </div>
</DemoBlock>

<AttributeTable Items="GetNotificationItem()" Title="NotificationItem" />
